package com.j48.entrancegurad.service.impl;

import com.j48.entrancegurad.model.Host_openid;
import com.j48.entrancegurad.service.WxService;
import com.j48.entrancegurad.mapper.WxMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class Wx_Service implements WxService {
    @Autowired
    private WxMapper wxMapper;

    /**
     * 查询openid对应信息
     * @param openid
     * @return
     */
    @Override
    public Host_openid HostOpenId(Host_openid openid) {
      if (wxMapper.SelectOpenId(openid)!=null){
          return openid;
      }
      return  null;
    }

    /**
     * 添加openid
     * @param openid
     * @return
     */
    @Override
    public boolean InsertOpenid(Host_openid openid) {
        if (wxMapper.InsertOpen(openid)>0){
            return  true;
        }
        return false;
    }
}
